import request from '@/utils/request'

// 获取托运工单列表
export function getEventsOrderList(params) {
  return request({
    url: `/adm/v1/eventsOrder/page/list`,
    method: 'get',
    params,
  })
}

// 根据ID获取数据
export function getEventsOrderById(id) {
  return request({
    url: `/adm/v1/eventsOrder/getOrderDetailById/` + id,
    method: 'get',
  })
}

// 创建
export function createEventsOrder(data) {
  return request({
    url: `/adm/v1/eventsOrder/createEventsOrder`,
    method: 'post',
    data,
  })
}

// 修改
export function updateEventsOrder(data) {
  return request({
    url: `/adm/v1/eventsOrder/updateEventsOrder`,
    method: 'put',
    data,
  })
}

// 修改金额
export function updateMoney(data) {
  return request({
    url: `/adm/v1/eventsOrder/updateMoney`,
    method: 'post',
    data,
  })
}

// 新增进度
export function createEventsSchedule(data) {
  return request({
    url: `/adm/v1/consignSchedule/createEventsSchedule`,
    method: 'post',
    data,
  })
}

// 根据订单id，查询进度
export function getEventsScheduleListById(id) {
  return request({
    url: `/adm/v1/consignSchedule/getEventsScheduleListById/` + id,
    method: 'get',
  })
}

// 退款
export function refund(data) {
  return request({
    url: `/adm/v1/eventsOrder/refund`,
    method: 'post',
    data,
  })
}
